package models

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

type Shop struct {
	Id     int    `json:"id"`
	Name   string `json:"name"`
	Price  string `json:"price"`
	Num    string `json:"num"`
	Weight string `json:"weight"`
	Ss     string `json:"ss"`
	Time   string `json:"time"`
}

var DB *gorm.DB

func init() {
	var err error
	dsn := "root:92754a22b4e3d6df76eeb8651e7ca916@tcp(14.103.195.108:3306)/demo3"
	DB, err = gorm.Open(mysql.Open(dsn))
	if err != nil {
		panic(err)
	}
	DB.AutoMigrate(&Shop{})
}
